package com.tianji.remark.controller;


import com.tianji.remark.domain.dto.LikeRecordFormDTO;
import com.tianji.remark.service.ILikedRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 点赞记录表 前端控制器
 * </p>
 *
 * @author yang
 * @since 2024-06-28
 */
@Api(tags = "点赞相关接口")
@RestController
@RequestMapping("/likes")
@RequiredArgsConstructor
public class LikedRecordController {

    private final ILikedRecordService likedRecordService;

    @PostMapping()
    @ApiOperation("点赞和取消")
    void likeRecord(@RequestBody LikeRecordFormDTO form){
        likedRecordService.likeRecord(form);
    }

    @GetMapping("/list")
    @ApiOperation("查询点赞状态")
    Set<Long> likedRecordList(@RequestParam("bizIds") List<Long> bizIds){
        return likedRecordService.likeRecordList(bizIds);
    }


}
